#include <jni.h>

#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <signal.h>

#include "entry.h"


JavaVM		*g_vm;
JNIEnv		*g_env;



jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) {
	JNIEnv* env = NULL;
	jint result = -1;

	log_info("hello jni!");

	g_vm = vm;

	if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4) != JNI_OK) {
		log_error("ERROR: GetEnv failed\n");
		goto bail;
	}
	assert(env != NULL);
	g_env = env;



	/* success -- return valid version number */
	result = JNI_VERSION_1_4;

	bail: return result;
}
